using MoMing.VideoTool.AppHost;

var builder = DistributedApplication.CreateBuilder(args);

builder.AddForwardedHeaders();

var redis = builder.AddRedis(AspireConstants.RIDES);
var postgres = builder.AddPostgres(AspireConstants.POSTGRES)
    .WithImage("ankane/pgvector")
    .WithImageTag("latest")
    ;

var videoTooldb = postgres.AddDatabase(AspireConstants.VIDEO_TOOL_DB);
//services
var videoToolApi = builder.AddProject<Projects.MoMing_VideoTool_API>(AspireConstants.VIDEO_TOOL_API_SERVICE)
    .WithReference(redis)
    .WithReference(videoTooldb)
    ;

var videoToolDownloader = builder.AddProject<Projects.MoMing_VideoTool_Downloader>(AspireConstants.VIDEO_TOOL_DOWNLOADER_SERVICE)
.WithReference(redis)
  .WithReference(videoTooldb)
;

var videoToolUploader = builder.AddProject<Projects.MoMing_VideoTool_Uploader>(AspireConstants.VIDEO_TOOL_UPLOADER_SERVICE)
.WithReference(videoTooldb)
.WithReference(videoToolDownloader)
;

builder.Build().Run();